package com.lemon.seatabank2.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;

/**
 * @program: seata-demo
 * @author: Mr.Young
 * @create: 2021/3/9 22:52
 **/
@Configuration
public class DbConfig {
    
    @Bean("db1")
    @ConfigurationProperties(prefix = "spring.datasource.p0")
    public DataSource dataSource(){
        return DataSourceBuilder.create().build();
    }
}
